<?xml version="1.0" encoding="UTF-8" ?>

<xsd:schema xmlns="http://symfony.com/schema/dic/swiftmailer"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://symfony.com/schema/dic/swiftmailer"
    elementFormDefault="qualified">

  <xsd:element name="config" type="config" />

  <xsd:complexType name="config">
    <xsd:sequence>
      <xsd:element name="mailer" type="mailer" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element name="antiflood" type="antiflood" minOccurs="0" maxOccurs="1" />
      <xsd:element name="spool" type="spool" minOccurs="0" maxOccurs="1" />
      <xsd:element name="delivery-whitelist-pattern" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>

    <xsd:attribute name="default-mailer" type="xsd:string" />

    <xsd:attributeGroup ref="mailer-config" />
  </xsd:complexType>

  <xsd:attributeGroup name="mailer-config">
      <xsd:attribute name="username" type="xsd:string" />
      <xsd:attribute name="password" type="xsd:string" />
      <xsd:attribute name="host" type="xsd:string" />
      <xsd:attribute name="port" type="xsd:string" />
      <xsd:attribute name="encryption" type="encryption" />
      <xsd:attribute name="auth-mode" type="auth_mode" />
      <xsd:attribute name="timeout" type="xsd:string"/>
      <xsd:attribute name="type" type="xsd:string" />
      <xsd:attribute name="source-ip" type="xsd:string"/>
      <xsd:attribute name="transport" type="xsd:string" />
      <xsd:attribute name="logging" type="xsd:string" />
      <xsd:attribute name="delivery-address" type="xsd:string" />
      <xsd:attribute name="disable-delivery" type="xsd:boolean" />
      <xsd:attribute name="sender-address" type="xsd:boolean" />
  </xsd:attributeGroup>

  <xsd:complexType name="mailer">
    <xsd:sequence>
      <xsd:element name="antiflood" type="antiflood" minOccurs="0" maxOccurs="1" />
      <xsd:element name="spool" type="spool" minOccurs="0" maxOccurs="1" />
      <xsd:element name="delivery-whitelist-pattern" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>

    <xsd:attribute name="name" type="xsd:string" />
    <xsd:attributeGroup ref="mailer-config" />
  </xsd:complexType>

  <xsd:complexType name="spool">
    <xsd:attribute name="type" type="xsd:string" />
    <xsd:attribute name="path" type="xsd:string" />
    <xsd:attribute name="id" type="xsd:string" />
  </xsd:complexType>

  <xsd:complexType name="antiflood">
    <xsd:attribute name="threshold" type="xsd:string" />
    <xsd:attribute name="sleep" type="xsd:string" />
  </xsd:complexType>

  <xsd:simpleType name="encryption">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="tls" />
      <xsd:enumeration value="ssl" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="auth_mode">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="plain" />
      <xsd:enumeration value="login" />
      <xsd:enumeration value="cram-md5" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="delivery_strategy">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="realtime" />
      <xsd:enumeration value="spool" />
      <xsd:enumeration value="single-address" />
      <xsd:enumeration value="none" />
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>
